package bean;

import sun.nio.cs.ext.GB18030;

import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;

public class CharactorEncoding {
    public CharactorEncoding() {
    }

    public String toString(String str) {
        String text = ",";
        if(str !=null&& !"".equals(str)){
            try {
                text = new String(str.getBytes("iso8859-1"), "GB18030");
            }catch (UnsupportedEncodingException e){
                e.printStackTrace();
            }
        }
        return text;
    }
}
